﻿@model SportClubMvc.Model.SportsClubClasses.MemberModel

@{
    string updateTargetId = "skater" + Model.Id;
}

@using (Ajax.BeginForm("Edit", "Skate", new AjaxOptions { UpdateTargetId = updateTargetId, OnComplete = "ShowUpdateInfo()" }, new { @class = "form-horizontal" }))
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.Id)
    <div class="control-group">
        <div class="control-label">@Html.LabelFor(model => model.Name)</div>
        <div class="controls">
            @Html.TextBoxFor(x => x.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
    </div>
    
    <div class="control-group">
        <div class="control-label">@Html.LabelFor(model => model.Biography)</div>
        <div class="controls">
            @Html.TextAreaFor(model => model.Biography)
            @Html.ValidationMessageFor(model => model.Biography)
        </div>
    </div>
    <div class="control-group">
        <div class="control-label">
            @Html.LabelFor(model => model.SkaterClass)
        </div>
        <div class="controls">
            @Html.EditorFor(model => model.SkaterClass)
            @Html.ValidationMessageFor(model => model.SkaterClass)
        </div>
    </div>
    <div class="control-group">
        <div class="control-label">
            @Html.LabelFor(model => model.Birthdate)
        </div>
        <div class="controls">
            @Html.HiddenFor(model => model.Birthdate)

            @*@Html.EditorFor(model => model.Birthdate)*@
            <input type="text" id="datepicker" value="@Model.Birthdate.ToShortDateString()"/>
            @Html.ValidationMessageFor(model => model.Birthdate)
        </div>
    </div>
    <div class="control-group">
        <div class="control-label">
            @Html.LabelFor(model => model.SkaterClass)
        </div>
        <div class="controls">
            @Html.EditorFor(model => model.SkaterClass)
            @Html.ValidationMessageFor(model => model.SkaterClass)
        </div>
    </div>

    <p>
        <button type="submit" class="btn btn-warning btn-small"><i class="icon-white icon-hdd"></i>&nbsp;Oppdater</button>
        <button data-dismiss="modal" type="button" class="btn-primary btn"><i class="icon-white icon-off"></i>&nbsp;Avbryt</button>
    </p>
}
